/*
 *	Copyright 2011 ja4cli
 *
 *	Licensed under the Apache License, Version 2.0 (the "License");
 *	you may not use this file except in compliance with the License.
 *	You may obtain a copy of the License at
 *
 *		http://www.apache.org/licenses/LICENSE-2.0
 *
 *	Unless required by applicable law or agreed to in writing, software
 *	distributed under the License is distributed on an "AS IS" BASIS,
 *	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *	See the License for the specific language governing permissions and
 *	limitations under the License.
 */
package org.skarby.ja4cli.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Representation of a Parameter argument.<p/>
 * 
 * A {@link Parameter} argument should be understood as a argument that has both a definition and a value. eg.:
 * <pre>
 * java Program -myParameter someValue
 * </pre>
 * 
 * or:
 * 
 * <pre>
 * java Program --myParameter=someValue
 * </pre>
 * 
 * Where the combination of <code></code> and <code>myParameter</code> is a {@link Parameter}.
 * 
 * @author askarby
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Parameter {
	/**
	 * The name of the parameter, ie.:
	 * <ul>
	 * <li><code>p</code></li>
	 * <li><code>-p</code></li>
	 * <li><code>--parameter</code></li>
	 * </ul>
	 * If the value does not start with a single, double or more dashes, a single dash will be prepended.<p/>
	 * 
	 * If the value is specified as an empty String or omitted, the name of the parameter will
	 * be derived from the name of the annotated field, by lowercasing the name and prefixing it
	 * with a single dash. ie.:<p/>
	 * 
	 * <code>&064;Parameter private String name;</code><p/>
	 * 
	 * Becomes:<p/>
	 * 
	 * <code>-name</code>
	 * 
	 * @return the name of the parameter.
	 */
	String value() default "";
	
	/**
	 * Specifies aliases for the parameter. <p/>
	 * 
	 * It must follow the naming convention specified by the {@link Parameter#value()} 
	 * 
	 * @return the aliases to use for the Parameter.
	 * @see Parameter#value()
	 */
	String[] aliases() default {};
}
